<template>
  <div id="rChart" style="height: 20vh;width: 100%;"></div>
</template>
<script>
import * as echarts from "echarts";
require("echarts"); // echarts theme
export default {
  name: "areaEchart",
  data() {
    return {
      chart: null,
      options: {},
      max: "", //最大value值
      min: "", // 最小value值
      type: 0
    };
  },
  created() {
    // this.getData();
  },
  mounted() {
    this.initOptions();
    this.initCharts();
  },
  methods: {
    initOptions() {
      this.options = {
        title: {
          text: "食品许可概况"
        },
        legend: {
          data: ["总体数量","全省数量"]
        },
        radar: {
          // shape: 'circle',
          indicator: [
            { name: "新增数量", max: 100 },
            { name: "注销数量", max: 100 },
            { name: "吊销数量", max: 100 },
            { name: "过期数量", max: 100 }
          ]
        },
        series: [
          {
            name: "Budget vs spending",
            type: "radar",
            data: [
              {
                value: [34, 32, 33, 12],
                name: "总体数量"
              },
              {
                value: [83, 45, 66, 29],
                name: "全省数量"
              }
            ]
          }
        ]
      };
    },
    initCharts() {
      // echarts.registerMap("平潭", pingtan);
      this.chart = echarts.init(document.getElementById("rChart"));

      this.chart.setOption(this.options, true);
    }
  }
};
</script>
